package br.com.gerenciador_recursos.servlets;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import br.com.gerenciador_recursos.model.User;
import br.com.gerenciador_recursos.servlets.util.SessionUtil;
import br.com.gerenciador_recursos.util.Constants;

public class MyViewServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {

		System.out.println("MyViewServlet");

		User userSigned = SessionUtil.getUserSigned(req);
		
		req.setAttribute("user", userSigned);
		
		RequestDispatcher requestDispatcher = req.getRequestDispatcher(Constants.MY_VIEW_PATH);
		requestDispatcher.forward(req, res);
		
		
	}

}
